package com.ymatou.iapi.trading.sellerquery.testcase;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.query.seller.trading.api.parameter.GetSellerMainOrderListBean;
import com.ymatou.query.seller.trading.api.parameter.GetSellerMainOrderListResponse;
import com.ymatou.query.seller.trading.api.parameter.OrderEntities;
import com.ymatou.query.seller.trading.api.parameter.OrderInfo;
import com.ymatou.query.seller.trading.api.parameter.RequestCovertor;
import com.ymatou.query.seller.trading.api.parameter.SellerMainOrderListQueryModel;
import com.ymatou.query.seller.trading.api.parameter.Sp_GetSellerOrderList_v2;
import com.ymatou.query.seller.trading.api.parameter.Sp_GetSellerOrdersByOrderIds_v1;
import com.ymatou.query.seller.trading.api.parameter.Sp_GetSellerOrdersByOrderIds_v1.OrderTradingId;
import com.ymatou.query.seller.trading.api.parameter.Ymt_O_OrderNote;
import com.ymatou.query.seller.trading.api.parameter.Ymt_Order;
import com.ymatou.query.seller.trading.api.parameter.Ymt_OrderInfo;
import com.ymatou.query.seller.trading.api.parameter.Ymt_OrderState;
import com.ymatou.query.seller.trading.api.parameter.Ymt_OrderSummary;
import com.ymatou.query.seller.trading.api.service.OrderCreate;
import com.ymatou.query.trading.api.parameter.OrderConverter;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymt.utils.tag.P2;
import com.ymttest.common.entitie.BillInfo;
import com.ymttest.common.entitie.C2COrderInfo;
import com.ymttest.common.entitie.OrderItemInfo;
import com.ymttest.common.entitie.OrderSummary;
import com.ymttest.common.enums.OrderStatusEnum;
import com.ymttest.database.model.ProductPromotion;
import com.ymttest.database.model.Ymt_Bill;
import com.ymttest.database.model.Ymt_CreditDetail;
import com.ymttest.database.model.Ymt_OrderExt;
import com.ymttest.database.model.Ymt_OrderPostPay;
import com.ymttest.database.model.Ymt_OrderToBill;
import com.ymttest.database.model.Ymt_Order_Frozen;
import com.ymttest.database.model.Ymt_TradingItem;
import com.ymttest.utils.DataUtil;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.YMTDateUtil;

/**
 * @date 2016-06-28
 * @author songyefeng
 * @desc 商家后台订单列表
 */
@TestSuite
public class Ts_GetSellerMainOrderList {

	private static GetSellerMainOrderListBean getSellerMainOrderListBean;
	private static com.ymatou.query.seller.trading.api.service.GetSellerMainOrderListCall getSellerMainOrderListCall;
//	private static com.ymatou.iapi.trading.sellerquery.service.GetSellerMainOrderListCall getSellerMainOrderListCall;
	private static final String DEFAULTCSHARPDATEIME = "0001-01-01 00:00:00";

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取商家订单列表.开放: 多商品 and M端商品 and 主单号");
	}

	@Before
	public void caseUp() {
		getSellerMainOrderListBean = new GetSellerMainOrderListBean();
		getSellerMainOrderListCall = new com.ymatou.query.seller.trading.api.service.GetSellerMainOrderListCall();
//		getSellerMainOrderListCall = new com.ymatou.iapi.trading.sellerquery.service.GetSellerMainOrderListCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getSellerMainOrderListCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	private void verify() {
		GetSellerMainOrderListResponse expectedResponse = new GetSellerMainOrderListResponse();
		ConstructExpectedResponse(expectedResponse);
		GetSellerMainOrderListResponse actualResponse = getSellerMainOrderListCall
				.getSellerMainOrderListResponse();
		DataUtil.verify(expectedResponse.getAllRecordCount(),
				actualResponse.getAllRecordCount(), "验证AllRecordCount");
		List<OrderInfo> expects = expectedResponse.getOrderInfoList();
		List<OrderInfo> actuals = actualResponse.getOrderInfoList();
		DataUtil.verify(expects.size(), actuals.size(),
				"验证OrderInfoList的长度");
		for (int i = 0; i < expects.size(); i++) {
			OrderInfo exp = expects.get(i);
			int expOid = exp.getOrderId();
			boolean exists = actuals.stream().anyMatch(
					x -> x.getOrderId() == expOid);
			DataUtil.verify(true, exists, "验证期望的OrderId：" + expOid
					+ "在实际结果中是否出现");
			if (exists) {
				DataUtil.verify(exp.getOrderId(), actuals.get(i)
						.getOrderId(), "验证OrderId的排序");
				OrderInfo act = actuals.stream()
						.filter(x -> x.getOrderId() == expOid)
						.collect(Collectors.toList()).get(0);
				DataUtil.verify(exp.getUserId(), act.getUserId(),
						"验证OrderId[" + expOid + "]的UserId");
				DataUtil.verify(exp.getTotalRefundThirdPartyDiscount(), act.getTotalRefundThirdPartyDiscount(),
						"验证OrderId[" + expOid + "]的TotalRefundThirdPartyDiscount");
				DataUtil.verify(exp.getBuyerId(), act.getBuyerId(),
						"验证OrderId[" + expOid + "]的BuyerId");
				DataUtil.verifyDateEquals(exp.getAddTime(), act.getAddTime(),
						"验证OrderId[" + expOid + "]的AddTime");
				DataUtil.verifyDecimalEquals(exp.getOrderPrice(),
						act.getOrderPrice(), "验证OrderId[" + expOid
								+ "]的OrderPrice");
				DataUtil.verifyDecimalEquals(exp.getOrderDiscount(),
						act.getOrderDiscount(), "验证OrderId[" + expOid
								+ "]的OrderDiscount");
				DataUtil.verifyDecimalEquals(exp.getFreight(),
						act.getFreight(), "验证OrderId[" + expOid + "]的Freight");
				DataUtil.verifyDecimalEquals(exp.getDiscount(),
						act.getDiscount(), "验证OrderId[" + expOid + "]的Discount");
//				DataUtil.verify(exp.getTradingId(), act.getTradingId(),
//						"验证OrderId[" + expOid + "]的TradingId");
				DataUtil.verify(exp.getOperate(), act.getOperate(),
						"验证OrderId[" + expOid + "]的Operate");
				DataUtil.verifyDateEquals(exp.getOperateExpireTime(),
						act.getOperateExpireTime(), "验证OrderId[" + expOid
								+ "]的OperateExpireTime");
				DataUtil.verify(exp.getAddress(), act.getAddress(),
						"验证OrderId[" + expOid + "]的Address");
				DataUtil.verify(exp.getPostCode(), act.getPostCode(),
						"验证OrderId[" + expOid + "]的PostCode");
				DataUtil.verify(exp.getReceivePerson(),
						act.getReceivePerson(), "验证OrderId[" + expOid
								+ "]的ReceivePerson");
				DataUtil.verify(exp.getPhone(), act.getPhone(),
						"验证OrderId[" + expOid + "]的Phone");
				DataUtil.verify(exp.getTelephone(), act.getTelephone(),
						"验证OrderId[" + expOid + "]的Telephone");
				DataUtil.verify(exp.getQQ(), act.getQQ(), "验证OrderId["
						+ expOid + "]的QQ");
				DataUtil.verify(exp.getEmail(), act.getEmail(),
						"验证OrderId[" + expOid + "]的Email");
				DataUtil.verify(exp.getLeaveWord(), act.getLeaveWord(),
						"验证OrderId[" + expOid + "]的LeaveWord");
				DataUtil.verify(exp.getUnfreezeStatus(),
						act.getUnfreezeStatus(), "验证OrderId[" + expOid
								+ "]的UnfreezeStatus");
				DataUtil.verifyDateEquals(exp.getDispathTime(),
						act.getDispathTime(), "验证OrderId[" + expOid
								+ "]的DispathTime");
				DataUtil.verify(exp.getTopicId(), act.getTopicId(),
						"验证OrderId[" + expOid + "]的TopicId");
				DataUtil.verify(exp.getTitle(), act.getTitle(),
						"验证OrderId[" + expOid + "]的Title");
				DataUtil.verify(exp.getReplyTopicWhenOrderPaid(),
						act.getReplyTopicWhenOrderPaid(), "验证OrderId[" + expOid
								+ "]的ReplyTopicWhenOrderPaid");
				DataUtil.verify(exp.isPaidInFull(), act.isPaidInFull(),
						"验证OrderId[" + expOid + "]的PaidInFull");
				DataUtil.verifyDecimalEquals(exp.getUseGiftAmount(),
						act.getUseGiftAmount(), "验证OrderId[" + expOid
								+ "]的UseGiftAmount");
				DataUtil.verify(exp.getCouponCode(), act.getCouponCode(),
						"验证OrderId[" + expOid + "]的CouponCode");
				DataUtil.verifyDecimalEquals(exp.getCouponValue(),
						act.getCouponValue(), "验证OrderId[" + expOid
								+ "]的CouponValue");
				DataUtil.verify(exp.getCouponType(), act.getCouponType(),
						"验证OrderId[" + expOid + "]的CouponType");
				DataUtil.verifyDateEquals(exp.getPaidTime(), act.getPaidTime(),
						"验证OrderId[" + expOid + "]的PaidTime");
				DataUtil.verifyDateEquals(exp.getApplyPostPayTime(),
						act.getApplyPostPayTime(), "验证OrderId[" + expOid
								+ "]的ApplyPostPayTime");
				DataUtil.verifyDateEquals(exp.getPostPaidTime(),
						act.getPostPaidTime(), "验证OrderId[" + expOid
								+ "]的PostPaidTime");
				DataUtil.verifyDateEquals(exp.getAcceptTime(),
						act.getAcceptTime(), "验证OrderId[" + expOid
								+ "]的AcceptTime");
				DataUtil.verifyDateEquals(exp.getConfirmedTime(),
						act.getConfirmedTime(), "验证OrderId[" + expOid
								+ "]的ConfirmedTime");
				DataUtil.verifyDateEquals(exp.getChangeAddressTime(),
						act.getChangeAddressTime(), "验证OrderId[" + expOid
								+ "]的ChangeAddressTime");
				DataUtil.verify(exp.getDistributor(),
						act.getDistributor(), "验证OrderId[" + expOid
								+ "]的Distributor");
				DataUtil.verify(exp.getThirdOrderId(),
						act.getThirdOrderId(), "验证OrderId[" + expOid
								+ "]的ThirdOrderId");
				DataUtil.verify(exp.getType(), act.getType(),
						"验证OrderId[" + expOid + "]的Type");
				DataUtil.verifyDecimalEquals(exp.getOldFreight(),
						act.getOldFreight(), "验证OrderId[" + expOid
								+ "]的OldFreight");
				DataUtil.verifyDateEquals(exp.getDiscountTime(),
						act.getDiscountTime(), "验证OrderId[" + expOid
								+ "]的DiscountTime");
				DataUtil.verifyDecimalEquals(exp.getOldDiscount(),
						act.getOldDiscount(), "验证OrderId[" + expOid
								+ "]的OldDiscount");
				DataUtil.verifyDecimalEquals(exp.getAutoCancelOrderHours(),
						act.getAutoCancelOrderHours(), "验证OrderId[" + expOid
								+ "]的AutoCancelOrderHours");
				DataUtil.verifyDateEquals(exp.getCancelTime(),
						act.getCancelTime(), "验证OrderId[" + expOid
								+ "]的CancelTime");
				DataUtil.verify(exp.isShangouOrder(),
						act.isShangouOrder(), "验证OrderId[" + expOid
								+ "]的ShangouOrder");
				DataUtil.verify(exp.getBuyerLoginId(),
						act.getBuyerLoginId(), "验证OrderId[" + expOid
								+ "]的BuyerLoginId");
				DataUtil.verify(exp.getBuyerLoginEmail(),
						act.getBuyerLoginEmail(), "验证OrderId[" + expOid
								+ "]的BuyerLoginEmail");
				DataUtil.verify(exp.getSellerLoginId(),
						act.getSellerLoginId(), "验证OrderId[" + expOid
								+ "]的SellerLoginId");
				DataUtil.verify(exp.getSellerLoginEmail(),
						act.getSellerLoginEmail(), "验证OrderId[" + expOid
								+ "]的SellerLoginEmail");
				DataUtil.verify(exp.getIsMerchant(), act.getIsMerchant(),
						"验证OrderId[" + expOid + "]的IsMerchant");
				DataUtil.verify(exp.getBuyerNickName(),
						act.getBuyerNickName(), "验证OrderId[" + expOid
								+ "]的BuyerNickName");
				DataUtil.verifyDecimalEquals(exp.getTotalPrice(),
						act.getTotalPrice(), "验证OrderId[" + expOid
								+ "]的TotalPrice");
				DataUtil.verifyDecimalEquals(exp.getUseFreeCardAmount(),
						act.getUseFreeCardAmount(), "验证OrderId[" + expOid
								+ "]的UseFreeCardAmount");
				DataUtil.verifyDateEquals(exp.getAutoReceiveTime(),
						act.getAutoReceiveTime(), "验证OrderId[" + expOid
								+ "]的AutoReceiveTime");
				DataUtil.verify(exp.isIsAutoReceiveEnabled(),
						act.isIsAutoReceiveEnabled(), "验证OrderId[" + expOid
								+ "]的IsAutoReceiveEnabled");
				DataUtil.verify(exp.isCredited(), act.isCredited(),
						"验证OrderId[" + expOid + "]的Credited");
				DataUtil.verify(exp.getCreditId(), act.getCreditId(),
						"验证OrderId[" + expOid + "]的CreditId");
				DataUtil.verify(exp.getCreditUserId(),
						act.getCreditUserId(), "验证OrderId[" + expOid
								+ "]的CreditUserId");
				DataUtil.verify(exp.getCreditServiceRange(),
						act.getCreditServiceRange(), "验证OrderId[" + expOid
								+ "]的CreditServiceRange");
				DataUtil.verify(exp.getCreditUniformityRange(),
						act.getCreditUniformityRange(), "验证OrderId[" + expOid
								+ "]的CreditUniformityRange");
				DataUtil.verify(exp.getCreditScoreRange(),
						act.getCreditScoreRange(), "验证OrderId[" + expOid
								+ "]的CreditScoreRange");
				DataUtil.verify(exp.getCreditDescript(),
						act.getCreditDescript(), "验证OrderId[" + expOid
								+ "]的CreditDescript");
				DataUtil.verifyDateEquals(
						DataUtil.Stringg.getValueOrDefault(
								exp.getCreditAddTime(), DEFAULTCSHARPDATEIME),
						act.getCreditAddTime(), "验证OrderId[" + expOid
								+ "]的CreditAddTime");
				DataUtil.verifyDateEquals(DataUtil.Stringg.getValueOrDefault(
						exp.getCreditUpdateTime(), DEFAULTCSHARPDATEIME), act
						.getCreditUpdateTime(), "验证OrderId[" + expOid
						+ "]的CreditUpdateTime");
				DataUtil.verifyDateEquals(exp.getCreditSellerReply(),
						act.getCreditSellerReply(), "验证OrderId[" + expOid
								+ "]的CreditSellerReply");
				DataUtil.verifyDateEquals(DataUtil.Stringg.getValueOrDefault(
						exp.getCreditSellerReplyUpdateTime(),
						DEFAULTCSHARPDATEIME), act
						.getCreditSellerReplyUpdateTime(), "验证OrderId["
						+ expOid + "]的CreditSellerReplyUpdateTime");
				DataUtil.verify(exp.getSellerNote(), act.getSellerNote(),
						"验证OrderId[" + expOid + "]的SellerNote");
				DataUtil.verify(exp.getLogisticsType(),
						act.getLogisticsType(), "验证OrderId[" + expOid
								+ "]的LogisticsType");
				DataUtil.verify(exp.getStockStatus(),
						act.getStockStatus(), "验证OrderId[" + expOid
								+ "]的StockStatus");
				DataUtil.verify(exp.isDelayReceiveFrozened(),
						act.isDelayReceiveFrozened(), "验证OrderId[" + expOid
								+ "]的DelayReceiveFrozened");
				DataUtil.verifyDateEquals(exp.getDelayReceiveFrozenTime(),
						act.getDelayReceiveFrozenTime(), "验证OrderId[" + expOid
								+ "]的DelayReceiveFrozenTime");
				DataUtil.verifyDateEquals(exp.getDelayReceiveUpdateTime(),
						act.getDelayReceiveUpdateTime(), "验证OrderId[" + expOid
								+ "]的DelayReceiveUpdateTime");
				DataUtil.verifyDateEquals(exp.getDelayReceiveAddTime(),
						act.getDelayReceiveAddTime(), "验证OrderId[" + expOid
								+ "]的DelayReceiveAddTime");
				DataUtil.verify(exp.getDelayReceiveUserId(),
						act.getDelayReceiveUserId(), "验证OrderId[" + expOid
								+ "]的DelayReceiveUserId");
				DataUtil.verifyDateEquals(exp.getDispatchTime(),
						act.getDispatchTime(), "验证OrderId[" + expOid
								+ "]的DispatchTime");
				DataUtil.verify(exp.isFrozen(), act.isFrozen(),
						"验证OrderId[" + expOid + "]的Frozen");
				DataUtil.verifyDecimalEquals(exp.getRefund(), act.getRefund(),
						"验证OrderId[" + expOid + "]的Refund");
				DataUtil.verifyDecimalEquals(exp.getNeedPostPay(),
						act.getNeedPostPay(), "验证OrderId[" + expOid
								+ "]的NeedPostPay");
				DataUtil.verifyDecimalEquals(exp.getRealPay(),
						act.getRealPay(), "验证OrderId[" + expOid + "]的RealPay");
				DataUtil.verifyDecimalEquals(exp.getRealPaidAmountOfGift(),
						act.getRealPaidAmountOfGift(), "验证OrderId[" + expOid
								+ "]的RealPaidAmountOfGift");
				DataUtil.verifyDecimalEquals(exp.getNeedPrePayAmountOfCash(),
						act.getNeedPrePayAmountOfCash(), "验证OrderId[" + expOid
								+ "]的NeedPrePayAmountOfCash");
				DataUtil.verifyDecimalEquals(exp.getRealPostPay(),
						act.getRealPostPay(), "验证OrderId[" + expOid
								+ "]的RealPostPay");
				DataUtil.verifyDecimalEquals(exp.getPostPaidAmountOfGift(),
						act.getPostPaidAmountOfGift(), "验证OrderId[" + expOid
								+ "]的PostPaidAmountOfGift");
				DataUtil.verifyDecimalEquals(exp.getPostPaidAmountOfCoupon(),
						act.getPostPaidAmountOfCoupon(), "验证OrderId[" + expOid
								+ "]的PostPaidAmountOfCoupon");
				DataUtil.verifyDecimalEquals(exp.getFirstPay(),
						act.getFirstPay(), "验证OrderId[" + expOid + "]的FirstPay");
				DataUtil.verify(exp.getPlatformEnum(),
						act.getPlatformEnum(), "验证OrderId[" + expOid
								+ "]的PlatformEnum");
				DataUtil.verifyDecimalEquals(exp.getRealPaidAmountOfCash(),
						act.getRealPaidAmountOfCash(), "验证OrderId[" + expOid
								+ "]的RealPaidAmountOfCash");
				DataUtil.verify(exp.isIsShippedByXlobo(),
						act.isIsShippedByXlobo(), "验证OrderId[" + expOid
								+ "]的IsShippedByXlobo");
				DataUtil.verify(exp.getThirdPartyRefundStatus(),
						act.getThirdPartyRefundStatus(), "验证OrderId[" + expOid
								+ "]的ThirdPartyRefundStatus");
				DataUtil.verifyDecimalEquals(exp.getPaidAmountOfFreeCard(),
						act.getPaidAmountOfFreeCard(), "验证OrderId[" + expOid
								+ "]的PaidAmountOfFreeCard");
				DataUtil.verifyDecimalEquals(exp.getPaidAmountOfCoupon(),
						act.getPaidAmountOfCoupon(), "验证OrderId[" + expOid
								+ "]的PaidAmountOfCoupon");
				DataUtil.verify(exp.isSupportLocalRefund(),
						act.isSupportLocalRefund(), "验证OrderId[" + expOid
								+ "]的SupportLocalRefund");
				DataUtil.verifyDateEquals(exp.getLocalRefundApplyTime(),
						act.getLocalRefundApplyTime(), "验证OrderId[" + expOid
								+ "]的LocalRefundApplyTime");
				DataUtil.verify(exp.getRiskVerifiedStatus(),
						act.getRiskVerifiedStatus(), "验证OrderId[" + expOid
								+ "]的RiskVerifiedStatus");
				DataUtil.verifyDecimalEquals(exp.getSellerCouponAmount(),
						act.getSellerCouponAmount(), "验证OrderId[" + expOid
								+ "]的SellerCouponAmount");
				DataUtil.verify(exp.getSalesRefundStatus(),
						act.getSalesRefundStatus(), "验证OrderId[" + expOid
								+ "]的SalesRefundStatus");
				DataUtil.verifyDecimalEquals(exp.getTotalSalesRefundAmount(),
						act.getTotalSalesRefundAmount(), "验证OrderId[" + expOid
								+ "]的TotalSalesRefundAmount");
				DataUtil.verifyDecimalEquals(
						exp.getRealSettlementAmountOfCoupon(),
						act.getRealSettlementAmountOfCoupon(), "验证OrderId["
								+ expOid + "]的RealSettlementAmountOfCoupon");
				DataUtil.verifyDecimalEquals(exp.getTotalPriceChange(),
						act.getTotalPriceChange(), "验证OrderId[" + expOid
								+ "]的TotalPriceChange");
				DataUtil.verify(
						exp.getPackageDelivery_DomesticDelivered(),
						act.getPackageDelivery_DomesticDelivered(),
						"验证OrderId[" + expOid
								+ "]的PackageDelivery_DomesticDelivered");
				DataUtil.verify(exp.getCancelReason(),
						act.getCancelReason(), "验证OrderId[" + expOid
								+ "]的CancelReason");
				DataUtil.verify(exp.isNeedUploadIdCard(),
						act.isNeedUploadIdCard(), "验证OrderId[" + expOid
								+ "]的NeedUploadIdCard");
				DataUtil.verify(exp.isHaveUploadedIdCard(),
						act.isHaveUploadedIdCard(), "验证OrderId[" + expOid
								+ "]的HaveUploadedIdCard");
				DataUtil.verify(exp.getSellerCouponCode(),
						act.getSellerCouponCode(), "验证OrderId[" + expOid
								+ "]的SellerCouponCode");
				DataUtil.verify(exp.getYmtCouponCode(),
						act.getYmtCouponCode(), "验证OrderId[" + expOid
								+ "]的YmtCouponCode");
				DataUtil.verifyDecimalEquals(exp.getYmtCouponAmount(),
						act.getYmtCouponAmount(), "验证OrderId[" + expOid
								+ "]的YmtCouponAmount");
				DataUtil.verifyDecimalEquals(exp.getPaidAmountOfYmtCoupon(),
						act.getPaidAmountOfYmtCoupon(), "验证OrderId[" + expOid
								+ "]的PaidAmountOfYmtCoupon");
				DataUtil.verifyDecimalEquals(exp.getPayableAmount(),
						act.getPayableAmount(), "验证OrderId[" + expOid
								+ "]的PayableAmount");
				DataUtil.verify(exp.getMainOrderId(),
						act.getMainOrderId(), "验证OrderId[" + expOid
								+ "]的MainOrderId");
				DataUtil.verify(exp.getRemarkLevel(),
						act.getRemarkLevel(), "验证OrderId[" + expOid
								+ "]的RemarkLevel");
				DataUtil.verifyDecimalEquals(exp.getPromotionReducedAmount(),
						act.getPromotionReducedAmount(), "验证OrderId[" + expOid
								+ "]的PromotionReducedAmount");
				DataUtil.verify(exp.getIsNewSellerOrder(),
						act.getIsNewSellerOrder(), "验证OrderId[" + expOid
								+ "]的IsNewSellerOrder");
				DataUtil.verify(exp.getIsNewCustomerOrder(),
						act.getIsNewCustomerOrder(), "验证OrderId[" + expOid
								+ "]的IsNewCustomerOrder");
				Logger.comment("开始验证OrderId[" + expOid + "]订单的BillCodeList");
				if (null == exp.getBillCodeList()) {
					DataUtil.verify(null, act.getBillCodeList(),
							"验证验证OrderId[" + expOid + "]订单的BillCodeList为null");
				} else {
					DataUtil.verify(exp.getBillCodeList().size(), act
							.getBillCodeList().size(), "验证验证OrderId[" + expOid
							+ "]订单的BillCodeList的size()");
					for (String expect : exp.getBillCodeList()) {
						DataUtil.verify(true, act.getBillCodeList()
								.stream().anyMatch(x -> x.equals(expect)),
								"验证验证OrderId[" + expOid + "]订单的期望值[" + expect
										+ "]是否出现在BillCodeList中");
					}
				}

				Logger.comment("结束验证OrderId[" + expOid + "]订单的BillCodeList");
				Logger.comment("开始验证OrderId[" + expOid + "]订单的BillInfoList");
				DataUtil.verify(exp.getBillInfoList().size(), act
						.getBillInfoList().size(), "验证验证OrderId[" + expOid
						+ "]订单的BillInfoList的size()");
				for (BillInfo expect : exp.getBillInfoList()) {
					String expBid = expect.getBillId();
					boolean flag = act.getBillInfoList().stream()
							.anyMatch(x -> x.getBillId().equals(expBid));
					DataUtil.verify(true, flag, "验证OrderId[" + expOid
							+ "]订单的BillId=[" + expBid + "]是否出现在BillInfoList中");
					if (flag) {
						BillInfo actual = act.getBillInfoList().stream()
								.filter(x -> x.getBillId().equals(expBid))
								.collect(Collectors.toList()).get(0);
						verifyBillInfo(expect, actual, expOid, expBid);
					}
				}
				Logger.comment("开始验证OrderId[" + expOid + "]订单的OrderItemList");
				DataUtil.verify(exp.getOrderItemList().size(), act
						.getOrderItemList().size(), "验证OrderId[" + expOid
						+ "]订单的OrderItemList的size()");
				for (OrderItemInfo expect : exp.getOrderItemList()) {
					String expOrderItemId = expect.getOrderItemId();
					boolean flag = act
							.getOrderItemList()
							.stream()
							.anyMatch(
									x -> x.getOrderItemId().equals(
											expOrderItemId));
					DataUtil.verify(true, flag, "验证OrderId[" + expOid
							+ "]订单的OrderItemId=[" + expOrderItemId
							+ "]是否出现在OrderItemList中");
					if (flag) {
						OrderItemInfo actual = act
								.getOrderItemList()
								.stream()
								.filter(x -> x.getOrderItemId().equals(
										expOrderItemId))
								.collect(Collectors.toList()).get(0);
						verifyOrderItem(expect, actual, expOid, expOrderItemId);
					}
				}
				Logger.comment("结束验证OrderId[" + expOid + "]订单的OrderItemList");

				Logger.comment("开始验证OrderId[" + expOid + "]订单的OrderSummaryList");
				DataUtil.verify(exp.getOrderSummaryList().size(), act
						.getOrderSummaryList().size(), "验证OrderId[" + expOid
						+ "]订单的OrderSummaryList的size()");
				for (OrderSummary expect : exp.getOrderSummaryList()) {
					boolean flag = act
							.getOrderSummaryList()
							.stream()
							.anyMatch(
									x -> x.getBillType() == expect
											.getBillType()
											&& x.getSummary().equals(
													expect.getSummary()));
					DataUtil.verify(true, flag, "验证OrderId[" + expOid
							+ "]订单, BillType=[" + expect.getBillType()
							+ "],且Summary=[" + expect.getSummary()
							+ "]存在于OrderSummaryList中");
				}
				Logger.comment("结束验证OrderId[" + expOid + "]订单的OrderSummaryList");
			}
		}
	}

	private void verifyOrderItem(OrderItemInfo expect, OrderItemInfo actual,
			int expOid, String expOrderItemId) {
		DataUtil.verify(expect.isSailProtected(),
				actual.isSailProtected(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的SailProtected");
		DataUtil.verifyDecimalEquals(expect.getPrice(), actual.getPrice(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的Price");
		DataUtil.verify(expect.getPropertyInfo(),
				actual.getPropertyInfo(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的PropertyInfo");
		DataUtil.verify(expect.getAmount(), actual.getAmount(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的Amount");
		DataUtil.verify(expect.getItemType(), actual.getItemType(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的ItemType");
		DataUtil.verify(expect.getCatalogId(), actual.getCatalogId(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的CatalogId");
		DataUtil.verify(expect.getProductId(), actual.getProductId(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的ProductId");
		DataUtil.verify(expect.getDescription(), actual.getDescription(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的Description");
		DataUtil.verify(expect.getOrderItemId(), actual.getOrderItemId(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的OrderItemId");
		DataUtil.verify(expect.getPictureUrl(), actual.getPictureUrl(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的PictureUrl");
		DataUtil.verify(expect.getReferenceUrl(),
				actual.getReferenceUrl(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的ReferenceUrl");
		DataUtil.verify(expect.getTitle(), actual.getTitle(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的Title");
		DataUtil.verify(expect.getSubProductCategoryId(),
				actual.getSubProductCategoryId(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的SubProductCategoryId");
		DataUtil.verify(expect.getLogisticsType(),
				actual.getLogisticsType(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的LogisticsType");
		DataUtil.verify(expect.getStockStatus(), actual.getStockStatus(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的StockStatus");
		DataUtil.verifyDecimalEquals(expect.getPremium(), actual.getPremium(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的Premium");
		DataUtil.verify(expect.getSku(), actual.getSku(), "验证OrderId["
				+ expOid + "]订单的OrderItemId=[" + expOrderItemId + "]的Sku");
		DataUtil.verify(expect.isIsCost(), actual.isIsCost(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的IsCost");
		DataUtil.verify(expect.getPriceType(), actual.getPriceType(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的PriceType");
		DataUtil.verify(expect.getBondedArea(), actual.getBondedArea(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的BondedArea");
		DataUtil.verify(expect.getProductRefundChannel(),
				actual.getProductRefundChannel(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的ProductRefundChannel");

		Logger.comment("开始验证OrderId[" + expOid + "]订单的OrderItemId=["
				+ expOrderItemId + "]的OrderItemInfoExt");
		if (expect.getOrderItemInfoExt() == null) {
			DataUtil.verify(expect.getOrderItemInfoExt(),
					actual.getOrderItemInfoExt(), "验证OrderId[" + expOid
							+ "]订单的OrderItemId=[" + expOrderItemId
							+ "]的OrderItemInfoExt对象为null");
		} else {
			DataUtil.verify(expect.getOrderItemInfoExt().getActivityId(),
					actual.getOrderItemInfoExt().getActivityId(), "验证OrderId["
							+ expOid + "]订单的OrderItemId=[" + expOrderItemId
							+ "]的OrderItemInfoExt对象的ActivityId");
			DataUtil.verify(expect.getOrderItemInfoExt()
					.getActivityTemplateId(), actual.getOrderItemInfoExt()
					.getActivityTemplateId(), "验证OrderId[" + expOid
					+ "]订单的OrderItemId=[" + expOrderItemId
					+ "]的OrderItemInfoExt对象的ActivityTemplateId");
			DataUtil.verify(expect.getOrderItemInfoExt()
					.getGiftAvail4Reward(), actual.getOrderItemInfoExt()
					.getGiftAvail4Reward(), "验证OrderId[" + expOid
					+ "]订单的OrderItemId=[" + expOrderItemId
					+ "]的OrderItemInfoExt对象的GiftAvail4Reward");
		}
		Logger.comment("完成验证OrderId[" + expOid + "]订单的OrderItemId=["
				+ expOrderItemId + "]的OrderItemInfoExt");
		DataUtil.verifyDecimalEquals(expect.getSellerCouponAmount(),
				actual.getSellerCouponAmount(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的SellerCouponAmount");
		DataUtil.verifyDecimalEquals(expect.getYmtCouponAmount(),
				actual.getYmtCouponAmount(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的YmtCouponAmount");
		DataUtil.verifyDecimalEquals(expect.getDiscount(),
				actual.getDiscount(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId + "]的Discount");
		DataUtil.verifyDecimalEquals(expect.getFreight(), actual.getFreight(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的Freight");
		DataUtil.verifyDecimalEquals(expect.getProductPrice(),
				actual.getProductPrice(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的ProductPrice");
		DataUtil.verify(expect.getRefundBillNo(),
				actual.getRefundBillNo(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的RefundBillNo");
		DataUtil.verifyDecimalEquals(expect.getProductOriginalPrice(),
				actual.getProductOriginalPrice(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的ProductOriginalPrice");
		DataUtil.verify(expect.getTariffType(), actual.getTariffType(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的TariffType");
		DataUtil.verify(expect.getSalesType(), actual.getSalesType(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的SalesType");
//		DataUtil.verify(expect.getPromotion(), actual.getPromotion(),
//				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
//						+ "]的Promotion");
		verifyPromotion(expect.getPromotion(), actual.getPromotion(), expOid, expOrderItemId);
		DataUtil.verify(expect.isSupportRtnWithoutReason(),
				actual.isSupportRtnWithoutReason(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的SupportRtnWithoutReason");
		DataUtil.verify(expect.getFreightFree(), actual.getFreightFree(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的FreightFree");
		DataUtil.verify(expect.getStockStatus(), actual.getStockStatus(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的StockStatus");
	}
	
	private void verifyPromotion(ProductPromotion expect,ProductPromotion actual,int expOid, String expOrderItemId){
		if(expect == null){
			DataUtil.verify(null, actual,"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId+ "]的Promotion==null");
		}else{
			DataUtil.verify(expect.getCondition(), actual.getCondition(),"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId+ "]的Promotion.Condition");
			DataUtil.verify(expect.getContent(), actual.getContent(),"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId+ "]的Promotion.Content");
			DataUtil.verify(expect.getID(), actual.getID(),"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId+ "]的Promotion.ID");
			DataUtil.verify(expect.getName(), actual.getName(),"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId+ "]的Promotion.Name");
			DataUtil.verify(0,  DataUtil.BigDecimall.compare(expect.getPartialReducedAmount(), actual.getPartialReducedAmount()) ,"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId+ "]的Promotion.PartialReducedAmount, 期望值["+expect.getPartialReducedAmount()+"], 实际值["+actual.getPartialReducedAmount()+"]");
			DataUtil.verify(0,  DataUtil.BigDecimall.compare(expect.getReducedAmount(), actual.getReducedAmount()) ,"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId+ "]的Promotion.ReducedAmount, 期望值["+expect.getReducedAmount()+"], 实际值["+actual.getReducedAmount()+"]");
			DataUtil.verify(expect.getType(), actual.getType(),"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId+ "]的Promotion.Type");
		}
	}

	private void verifyBillInfo(BillInfo expect, BillInfo actual, int expOid,
			String expBid) {
		DataUtil.verify(expect.getAction(), actual.getAction(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid + "]的Action");
		DataUtil.verifyDateEquals(expect.getAddTime(), actual.getAddTime(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid + "]的AddTime");
		DataUtil.verify(expect.getBillCode(), actual.getBillCode(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的BillCode");
		DataUtil.verifyDecimalEquals(expect.getBillFee(), actual.getBillFee(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid + "]的BillFee");
		DataUtil.verify(expect.getBillSupplier(),
				actual.getBillSupplier(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的BillSupplier");
		DataUtil.verify(expect.getBillUrl(), actual.getBillUrl(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid + "]的BillUrl");
		DataUtil.verifyDecimalEquals(expect.getDeclarePrice(),
				actual.getDeclarePrice(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的DeclarePrice");
		DataUtil.verifyDecimalEquals(expect.getDeclareWeight(),
				actual.getDeclareWeight(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的DeclareWeight");
		DataUtil.verify(expect.getDeclineReason(),
				actual.getDeclineReason(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的DeclineReason");
		DataUtil.verify(expect.getDelReason(), actual.getDelReason(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的DelReason");
		DataUtil.verify(expect.getFromUserId(), actual.getFromUserId(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的FromUserId");
		DataUtil.verify(expect.getGoodName(), actual.getGoodName(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的GoodName");
		DataUtil.verify(expect.getIdCardPic(), actual.getIdCardPic(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的IdCardPic");
		DataUtil.verifyDecimalEquals(expect.getInsure(), actual.getInsure(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid + "]的Insure");
		DataUtil.verify(expect.getLogisticId(), actual.getLogisticId(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的LogisticId");
		DataUtil.verify(expect.getLogisticsStatu(),
				actual.getLogisticsStatu(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的LogisticsStatu");
		DataUtil.verifyDateEquals(expect.getMatchIdPicTime(),
				actual.getMatchIdPicTime(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的MatchIdPicTime");
		DataUtil.verifyDecimalEquals(expect.getRealWeight(),
				actual.getRealWeight(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的RealWeight");
		DataUtil.verify(expect.getReceiveAddress(),
				actual.getReceiveAddress(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的ReceiveAddress");
		DataUtil.verify(expect.getReceiveCity(), actual.getReceiveCity(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的ReceiveCity");
		DataUtil.verify(expect.getReceiveEmail(),
				actual.getReceiveEmail(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的ReceiveEmail");
		DataUtil.verify(expect.getReceiveName(), actual.getReceiveName(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的ReceiveName");
		DataUtil.verify(expect.getReceivePhone(),
				actual.getReceivePhone(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的ReceivePhone");
		DataUtil.verify(expect.getReceivePostcode(),
				actual.getReceivePostcode(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的ReceivePostcode");
		DataUtil.verify(expect.getReceiveProvince(),
				actual.getReceiveProvince(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的ReceiveProvince");
		DataUtil.verify(expect.getReceiveRegion(),
				actual.getReceiveRegion(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的ReceiveRegion");
		DataUtil.verify(expect.getSenderAddress(),
				actual.getSenderAddress(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的SenderAddress");
		DataUtil.verify(expect.getSenderName(), actual.getSenderName(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的SenderName");
		DataUtil.verify(expect.getSenderPhone(), actual.getSenderPhone(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的SenderPhone");
		DataUtil.verifyDecimalEquals(expect.getServiceCost(),
				actual.getServiceCost(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的ServiceCost");
		DataUtil.verify(expect.getSignLogisticId(),
				actual.getSignLogisticId(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的SignLogisticId");
		DataUtil.verify(expect.getSmallTicket(), actual.getSmallTicket(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的SmallTicket");
		DataUtil.verify(expect.getToUserId(), actual.getToUserId(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的ToUserId");
		DataUtil.verify(expect.getTransferCenter(),
				actual.getTransferCenter(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的TransferCenter");
		DataUtil.verify(expect.getTransPortNo(), actual.getTransPortNo(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的TransPortNo");
		DataUtil.verify(expect.getTransportServiceType(),
				actual.getTransportServiceType(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的TransportServiceType");
		DataUtil.verify(expect.getTxtChargeStatu(),
				actual.getTxtChargeStatu(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的TxtChargeStatu");
		DataUtil.verifyDecimalEquals(expect.getTxtFee(), actual.getTxtFee(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid + "]的TxtFee");
		DataUtil.verify(expect.getWeightChargeStatu(),
				actual.getWeightChargeStatu(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的WeightChargeStatu");
		DataUtil.verifyDecimalEquals(expect.getWeightFee(),
				actual.getWeightFee(), "验证验证OrderId[" + expOid + "]订单的BillId=["
						+ expBid + "]的WeightFee");
		DataUtil.verifyDateEquals(expect.getWeightNotifyDateTime(),
				actual.getWeightNotifyDateTime(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的WeightNotifyDateTime");
	}

	private void ConstructExpectedResponse(
			GetSellerMainOrderListResponse response) {
		Process(response);
	}

	private void Process(GetSellerMainOrderListResponse response) {
		SellerMainOrderListQueryModel model = RequestCovertor
				.SellerMainOrderListRequestArguments(getSellerMainOrderListBean);
		SellerMainOrderListResponseProcessor(model, response);
	}

	private void SellerMainOrderListResponseProcessor(
			SellerMainOrderListQueryModel model,
			GetSellerMainOrderListResponse response) {
		Sp_GetSellerOrderList_v2 sp = new Sp_GetSellerOrderList_v2();
		sp.setSellerId(model.getSellerId());
		sp.setOrderType(model.getOrderType());
		sp.setShangou(model.getShangou());
		sp.setOrderStatus(model.getOrderStatus());
		sp.setCatalogStatus(model.getCatalogStatus());
		sp.setAddBeginTime(model.getAddBeginTime());
		sp.setAddEndTime(model.getAddEndTime());
		sp.setPaidBeginTime(model.getPaidBeginTime());
		sp.setPaidEndTime(model.getPaidEndTime());
		sp.setPaidInFull(model.getPaidInFull());
		sp.setRowFrom(model.getPagination().getPageItemIndexFrom());
		sp.setRowTo(model.getPagination().getPageItemIndexTo());
		sp.setBuyerNickName(model.getBuyerNickName());
		sp.setProductName(model.getProductName());
		// sp.setConsiderOrderStatus(model.getSellerOrderStatusParams()
		// .isConsiderOrderStatus());
		// sp.setConsiderRCAccountPaid(model.getSellerOrderStatusParams()
		// .isConsiderRCAccountPaid());
		// sp.setConsiderRCOrderEstablish(model.getSellerOrderStatusParams()
		// .isConsiderRCOrderEstablish());
		// sp.setConsiderRestOrderStatus(model.getSellerOrderStatusParams()
		// .isConsiderRestOrderStatus());
		sp.setSalesRefundOrderOnly(model.isSalesRefundOrderOnly());
		sp.setDomesticDelivered(model.getDomesticDelivered());
		sp.setMainOrderId(model.getMainOrderId());
		sp.setOrderId(model.getOrderId());
		sp.setRemarkLevel(model.getRemarkLevel());
		Sp_GetSellerOrdersByOrderIds_v1 result = sp.execute();

		OrderEntities orderResult = ConvertResult(result.getTotalCount(),
				result.getOrderList(), result.getCreditDetailList(),
				result.getOrderNoteList(), result.getOrderStateList(),
				result.getPostPayList(), result.getOrderInfoList(),
				result.getOrderSummarieList(), result.getOrderFrozenList(),
				result.getOrderToBillList(), result.getBillList(),
				result.getTradingItemList(), result.getOrderExtList());
		List<com.ymatou.query.seller.trading.api.parameter.OrderInfo> orderInfoList = OrderConverter
				.AsOrderInfos(orderResult, true);
		response.setOrderInfoList(orderInfoList);
		response.setAllRecordCount(orderResult.getTotalCount());
	}

	@SuppressWarnings("rawtypes")
	private OrderEntities ConvertResult(int totalCount, List<Map> OrderList,
			List<Map> CreditDetailList, List<Map> OrderNoteList,
			List<Map> OrderStateList, List<Map> PostPayList,
			List<Map> OrderInfoList, List<Map> OrderSummarieList,
			List<Map> OrderFrozenList, List<Map> OrderToBillList,
			List<Map> BillList, List<OrderTradingId> TradingItemList,
			List<Map> OrderExtList) {
		OrderEntities entity = new OrderEntities();
		List<Ymt_Order> Orders = new ArrayList<Ymt_Order>();
		List<Ymt_CreditDetail> CreditDetails = new ArrayList<Ymt_CreditDetail>();
		List<Ymt_O_OrderNote> OrderNotes = new ArrayList<Ymt_O_OrderNote>();
		List<Ymt_OrderState> OrderStates = new ArrayList<Ymt_OrderState>();
		List<Ymt_OrderPostPay> PostPays = new ArrayList<Ymt_OrderPostPay>();
		List<Ymt_OrderInfo> OrderInfos = new ArrayList<Ymt_OrderInfo>();
		List<Ymt_OrderSummary> OrderSummaries = new ArrayList<Ymt_OrderSummary>();
		List<Ymt_Order_Frozen> OrderFrozens = new ArrayList<Ymt_Order_Frozen>();
		List<Ymt_OrderToBill> OrderToBills = new ArrayList<Ymt_OrderToBill>();
		List<Ymt_Bill> Bills = new ArrayList<Ymt_Bill>();
		List<Ymt_TradingItem> TradingItems = new ArrayList<Ymt_TradingItem>();
		List<Ymt_OrderExt> OrderExts = new ArrayList<Ymt_OrderExt>();
		entity.setTotalCount(totalCount);
		if (DataUtil.isNullOrEmpty(OrderList) == false) {
			for (Map m : OrderList) {
				Ymt_Order o = new Ymt_Order();
				DataUtil.mapToBean(o, m);
				Orders.add(o);
			}
		}
		if (DataUtil.isNullOrEmpty(CreditDetailList) == false) {
			for (Map m : CreditDetailList) {
				Ymt_CreditDetail o = new Ymt_CreditDetail();
				DataUtil.mapToBean(o, m);
				CreditDetails.add(o);
			}
		}
		if (DataUtil.isNullOrEmpty(OrderNoteList) == false) {
			for (Map m : OrderNoteList) {
				Ymt_O_OrderNote o = new Ymt_O_OrderNote();
				DataUtil.mapToBean(o, m);
				OrderNotes.add(o);
			}
		}
		if (DataUtil.isNullOrEmpty(OrderStateList) == false) {
			for (Map m : OrderStateList) {
				Ymt_OrderState o = new Ymt_OrderState();
				DataUtil.mapToBean(o, m);
				OrderStates.add(o);
			}
		}
		if (DataUtil.isNullOrEmpty(PostPayList) == false) {
			for (Map m : PostPayList) {
				Ymt_OrderPostPay o = new Ymt_OrderPostPay();
				DataUtil.mapToBean(o, m);
				PostPays.add(o);
			}
		}
		if (DataUtil.isNullOrEmpty(OrderInfoList) == false) {
			for (Map m : OrderInfoList) {
				Ymt_OrderInfo o = new Ymt_OrderInfo();
				DataUtil.mapToBean(o, m);
				OrderInfos.add(o);
			}
			if (DataUtil.isNullOrEmpty(OrderSummarieList) == false) {
				for (Map m : OrderSummarieList) {
					Ymt_OrderSummary o = new Ymt_OrderSummary();
					DataUtil.mapToBean(o, m);
					OrderSummaries.add(o);
				}
			}
			if (DataUtil.isNullOrEmpty(OrderFrozenList) == false) {
				for (Map m : OrderFrozenList) {
					Ymt_Order_Frozen o = new Ymt_Order_Frozen();
					DataUtil.mapToBean(o, m);
					OrderFrozens.add(o);
				}
			}
			if (DataUtil.isNullOrEmpty(OrderToBillList) == false) {
				for (Map m : OrderToBillList) {
					Ymt_OrderToBill o = new Ymt_OrderToBill();
					DataUtil.mapToBean(o, m);
					OrderToBills.add(o);
				}
			}
			if (DataUtil.isNullOrEmpty(BillList) == false) {
				for (Map m : BillList) {
					Ymt_Bill o = new Ymt_Bill();
					DataUtil.mapToBean(o, m);
					Bills.add(o);
				}
			}
			if (DataUtil.isNullOrEmpty(TradingItemList) == false) {
				for (OrderTradingId m : TradingItemList) {
					Ymt_TradingItem o = new Ymt_TradingItem();
					o.setiOrderId(m.getiOrderId());
					o.setiTradingId(m.getiTradingId());
					o.setdAddTime(m.getVirtualTime());
					TradingItems.add(o);
				}
			}
			if (DataUtil.isNullOrEmpty(OrderExtList) == false) {
				for (Map m : OrderExtList) {
					Ymt_OrderExt o = new Ymt_OrderExt();
					DataUtil.mapToBean(o, m);
					OrderExts.add(o);
				}
			}
		}
		entity.setCreditDetails(CreditDetails);
		entity.setOrderExts(OrderExts);
		entity.setOrderFrozens(OrderFrozens);
		entity.setOrderInfos(OrderInfos);
		entity.setOrderNotes(OrderNotes);
		entity.setOrders(Orders);
		entity.setOrderStates(OrderStates);
		entity.setOrderSummaries(OrderSummaries);
		entity.setOrderToBills(OrderToBills);
		entity.setPostPays(PostPays);
		entity.setTotalCount(totalCount);
		entity.setTradingItems(TradingItems);
		entity.setBills(Bills);
		return entity;
	}

	private static final String YMD = "yyyy-MM-dd";

	private static String calendar2YMDString(Calendar calendar) {
		return new SimpleDateFormat(YMD).format(calendar.getTime());
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_001() {
		Logger.start(true, "商家后台订单列表, 传入大量的请求参数, mssql查询");
		Calendar begin = Calendar.getInstance();
		begin.add(Calendar.MONTH, -6);
		Calendar end = Calendar.getInstance();
		String addBeginTme = calendar2YMDString(begin);
		String addEndTime = calendar2YMDString(end);
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
		Logger.comment("准备订单数据");
		OrderCreate o = new OrderCreate();
		C2COrderInfo order = o.create1_M2cOrder(userId, sellerId);
		try {
			Thread.sleep(1000l);
		} catch (InterruptedException e1) {
			e1.printStackTrace();
		}
		Logger.comment("完成准备订单数据");
		try {
			int pageNum = 1;
			int pageSize = 3;
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setAddBeginTime(addBeginTme);
			getSellerMainOrderListBean.setAddEndTime(addEndTime);
			getSellerMainOrderListBean.setMainOrderId(order.getiMainOrderId());
			getSellerMainOrderListBean.setOrderId(order.getiOrderId());
			List<Integer> orderStatusList = new ArrayList<Integer>();
			orderStatusList.add(OrderStatusEnum.OrderEstablish.getValue());
			getSellerMainOrderListBean.setOrderStatusList(orderStatusList);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_002() {
		int pageSize = 2;
		Logger.start(true, "商家后台订单列表, 时间跨度正好为6个月, mssql查询");
		Calendar begin = Calendar.getInstance();
		begin.add(Calendar.MONTH, -6);
		Calendar end = Calendar.getInstance();
		String addBeginTme = calendar2YMDString(begin);
		String addEndTime = calendar2YMDString(end);
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
		Logger.comment("准备订单数据");
		OrderCreate o = new OrderCreate();
		o.create17_AcceptOrder(userId, sellerId);
		Logger.comment("完成准备订单数据");
		try {
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setAddBeginTime(addBeginTme);
			getSellerMainOrderListBean.setAddEndTime(addEndTime);
			getSellerMainOrderListBean.setCurrentPageNum(5);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			int lastPage = (int) Math.ceil(getSellerMainOrderListCall
					.getAllRecordCount() / pageSize);
			Logger.comment("验证最后一页订单, 页号：" + lastPage);
			getSellerMainOrderListBean.setCurrentPageNum(lastPage);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_003() {
		Logger.start(true, "商家后台订单列表, mongo查询");
		Calendar begin = Calendar.getInstance();
		begin.add(Calendar.MONTH, -6);
		begin.add(Calendar.DATE, 3);
		Calendar end = Calendar.getInstance();
		end.add(Calendar.DATE, 1);
		String addBeginTime = calendar2YMDString(begin);
		String addEndTime = calendar2YMDString(end);
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int pageNum = 1;
		int pageSize = 2;
		try {
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setAddBeginTime(addBeginTime);
			getSellerMainOrderListBean.setAddEndTime(addEndTime);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_004() {
		Calendar begin = Calendar.getInstance();
		begin.add(Calendar.MONTH, -6);
		begin.add(Calendar.DATE, 2);
		Calendar end = Calendar.getInstance();
		end.add(Calendar.DATE, 1);
		String addBeginTime = calendar2YMDString(begin);
		String addEndTime = calendar2YMDString(end);
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int pageSize = 10;
		Logger.start(
				true,
				"商家后台订单列表, mongo开关打开(update dbo.Ymt_ThirdPartyRefundConfigs set Available=1 where [Key]='SellerIdForQuerySwitch')，时间跨度正好为6个月");
		try {
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setAddBeginTime(addBeginTime);
			getSellerMainOrderListBean.setAddEndTime(addEndTime);
			getSellerMainOrderListBean.setCurrentPageNum(1);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();

			int lastPage = (int) Math.ceil(getSellerMainOrderListCall
					.getAllRecordCount() / pageSize);
			Logger.comment("验证最后一页订单, 页号：" + lastPage);
			getSellerMainOrderListBean.setCurrentPageNum(lastPage);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_005() {
		Logger.start(true, "商家后台订单列表, 只传sellerId,pageNum,pageSize");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int pageNum = 1;
		int pageSize = 3;
		try {
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_006() {
		Logger.start(true, "商家后台订单列表, buyerNickName过滤");
		Calendar begin = Calendar.getInstance();
		begin.add(Calendar.MONTH, -6);
		begin.add(Calendar.DATE, 3);
		Calendar end = Calendar.getInstance();
		end.add(Calendar.DATE, 1);
		String addBeginTime = calendar2YMDString(begin);
		String addEndTime = calendar2YMDString(end);
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int pageNum = 1;
		int pageSize = 3;
		try {
			String buyerNickName = "test007";
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setAddBeginTime(addBeginTime);
			getSellerMainOrderListBean.setAddEndTime(addEndTime);
			getSellerMainOrderListBean.setBuyerNickName(buyerNickName);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	@Ignore
	public void Tc_GetSellerMainOrderList_007() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 订单状态(已付款)过滤");
		Calendar begin = Calendar.getInstance();
		begin.add(Calendar.MONTH, -6);
		begin.add(Calendar.DATE, 3);
		Calendar end = Calendar.getInstance();
		end.add(Calendar.DATE, 1);
		String addBeginTime = calendar2YMDString(begin);
		String addEndTime = calendar2YMDString(end);
		List<Integer> orderStatusList = new ArrayList<Integer>();
		orderStatusList.add(OrderStatusEnum.AccountPaid.getValue());
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));

		try {
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setAddBeginTime(addBeginTime);
			getSellerMainOrderListBean.setAddEndTime(addEndTime);
			getSellerMainOrderListBean.setOrderStatusList(orderStatusList);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_008() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 订单状态(订单确立)过滤");
		Calendar begin = Calendar.getInstance();
		begin.add(Calendar.MONTH, -6);
		begin.add(Calendar.DATE, 3);
		Calendar end = Calendar.getInstance();
		end.add(Calendar.DATE, 1);
		String addBeginTime = calendar2YMDString(begin);
		String addEndTime = calendar2YMDString(end);
		List<Integer> orderStatusList = new ArrayList<Integer>();
		orderStatusList.add(OrderStatusEnum.OrderEstablish.getValue());
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setAddBeginTime(addBeginTime);
			getSellerMainOrderListBean.setAddEndTime(addEndTime);
			getSellerMainOrderListBean.setOrderStatusList(orderStatusList);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_009() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 订单状态(订单补款完成, 等待发货)过滤");
		Calendar begin = Calendar.getInstance();
		begin.add(Calendar.MONTH, -6);
		begin.add(Calendar.DATE, 3);
		Calendar end = Calendar.getInstance();
		end.add(Calendar.DATE, 1);
		String addBeginTime = calendar2YMDString(begin);
		String addEndTime = calendar2YMDString(end);
		List<Integer> orderStatusList = new ArrayList<Integer>();
		orderStatusList.add(OrderStatusEnum.SellerAccept.getValue());
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		Boolean isPaidInFull = true;
		try {
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setAddBeginTime(addBeginTime);
			getSellerMainOrderListBean.setAddEndTime(addEndTime);
			getSellerMainOrderListBean.setOrderStatusList(orderStatusList);
			getSellerMainOrderListBean.setIsPaidInFull(isPaidInFull);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_010() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 订单状态(已确认接单,等待发起补款)过滤");
		Calendar begin = Calendar.getInstance();
		begin.add(Calendar.MONTH, -6);
		begin.add(Calendar.DATE, 3);
		Calendar end = Calendar.getInstance();
		end.add(Calendar.DATE, 1);
		String addBeginTime = calendar2YMDString(begin);
		String addEndTime = calendar2YMDString(end);
		List<Integer> orderStatusList = new ArrayList<Integer>();
		orderStatusList.add(OrderStatusEnum.SellerAccept.getValue());
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		Boolean isPaidInFull = false;
		try {
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setAddBeginTime(addBeginTime);
			getSellerMainOrderListBean.setAddEndTime(addEndTime);
			getSellerMainOrderListBean.setOrderStatusList(orderStatusList);
			getSellerMainOrderListBean.setIsPaidInFull(isPaidInFull);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_011() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 订单状态(确认收货)过滤");
		Calendar begin = Calendar.getInstance();
		begin.add(Calendar.MONTH, -6);
		begin.add(Calendar.DATE, 3);
		Calendar end = Calendar.getInstance();
		end.add(Calendar.DATE, 1);
		String addBeginTime = calendar2YMDString(begin);
		String addEndTime = calendar2YMDString(end);
		List<Integer> orderStatusList = new ArrayList<Integer>();
		orderStatusList.add(OrderStatusEnum.Received.getValue());
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setAddBeginTime(addBeginTime);
			getSellerMainOrderListBean.setAddEndTime(addEndTime);
			getSellerMainOrderListBean.setOrderStatusList(orderStatusList);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_012() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 订单状态(确认收货)过滤");
		Calendar begin = Calendar.getInstance();
		begin.add(Calendar.MONTH, -3);
		begin.add(Calendar.DATE, 3);
		Calendar end = Calendar.getInstance();
		end.add(Calendar.DATE, 1);
		String addBeginTime = calendar2YMDString(begin);
		String addEndTime = calendar2YMDString(end);
		List<Integer> orderStatusList = new ArrayList<Integer>();
		orderStatusList.add(OrderStatusEnum.Received.getValue());
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setAddBeginTime(addBeginTime);
			getSellerMainOrderListBean.setAddEndTime(addEndTime);
			getSellerMainOrderListBean.setOrderStatusList(orderStatusList);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_013() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 订单状态(已发货)过滤");
		Calendar begin = Calendar.getInstance();
		begin.add(Calendar.MONTH, -6);
		begin.add(Calendar.DATE, 3);
		Calendar end = Calendar.getInstance();
		end.add(Calendar.MONTH, -1);
		end.add(Calendar.DATE, 1);
		String addBeginTime = calendar2YMDString(begin);
		String addEndTime = calendar2YMDString(end);
		List<Integer> orderStatusList = new ArrayList<Integer>();
		orderStatusList.add(OrderStatusEnum.Shipped.getValue());
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setAddBeginTime(addBeginTime);
			getSellerMainOrderListBean.setAddEndTime(addEndTime);
			getSellerMainOrderListBean.setOrderStatusList(orderStatusList);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_014() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 根据订单过滤");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			int orderId = 105841565;
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setOrderId(orderId);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_015() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 根据主订单过滤");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			int mainOrderId = 8635037;
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setMainOrderId(mainOrderId);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	// @Ignore
	public void Tc_GetSellerMainOrderList_016() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 根据remarkLevel过滤");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			Integer remarkLevel = null;
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setRemarkLevel(remarkLevel);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_017() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 根据购买时间过滤, 查找mongo");
		try {
			int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			Calendar begin = Calendar.getInstance();
			begin.add(Calendar.MONTH, -1);
			begin.add(Calendar.DATE, 3);
			Calendar end = Calendar.getInstance();
			end.add(Calendar.DATE, 1);
			String paidBeginTime = calendar2YMDString(begin);
			String paidEndTime = calendar2YMDString(end);
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setAddBeginTime(paidBeginTime);
			getSellerMainOrderListBean.setAddEndTime(paidEndTime);
			getSellerMainOrderListBean.setPaidBeginTime(paidBeginTime);
			getSellerMainOrderListBean.setPaidEndTime(paidEndTime);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();

			if (getSellerMainOrderListCall.getAllRecordCount() > pageSize * 5) {
				int maxPageNum = (int) Math.ceil(getSellerMainOrderListCall
						.getAllRecordCount() / pageSize);
				pageNum = DataUtil.Random.getRandomIntFromRange(3, maxPageNum);
				Logger.comment("随机取一页数据，页号：" + pageNum);
				getSellerMainOrderListBean.setCurrentPageNum(pageNum);
				getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
				getSellerMainOrderListCall.callService();
				verify();
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_018() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 根据购买时间过滤, 查找mssql");
		try {
			int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			Calendar begin = Calendar.getInstance();
			begin.add(Calendar.MONTH, -7);
			Calendar end = Calendar.getInstance();
			end.add(Calendar.MONTH, -2);
			end.add(Calendar.DATE, 1);
			String paidBeginTime = calendar2YMDString(begin);
			String paidEndTime = calendar2YMDString(end);
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setAddBeginTime(paidBeginTime);
			getSellerMainOrderListBean.setAddEndTime(paidEndTime);
			getSellerMainOrderListBean.setPaidBeginTime(paidBeginTime);
			getSellerMainOrderListBean.setPaidEndTime(paidEndTime);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	// @Ignore
	public void Tc_GetSellerMainOrderList_019() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 根据remarkLevel过滤");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			Integer remarkLevel = 0;
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setRemarkLevel(remarkLevel);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	// @Ignore
	public void Tc_GetSellerMainOrderList_020() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 根据remarkLevel过滤");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			Integer remarkLevel = 1;
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setRemarkLevel(remarkLevel);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	// @Ignore
	public void Tc_GetSellerMainOrderList_021() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 根据remarkLevel过滤");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			Integer remarkLevel = 2;
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setRemarkLevel(remarkLevel);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	// @Ignore
	public void Tc_GetSellerMainOrderList_022() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 根据remarkLevel过滤");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			Integer remarkLevel = 3;
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setRemarkLevel(remarkLevel);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	// @Ignore
	public void Tc_GetSellerMainOrderList_023() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 根据remarkLevel过滤");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			Integer remarkLevel = 4;
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setRemarkLevel(remarkLevel);
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_024() throws Exception {
		Logger.start(true, "商家后台订单列表, 第一页第一条");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int userId = Integer.valueOf(EnvSetup.getData("BuyerId"));
//		OrderCreate create = new OrderCreate();
//		create.create4_RefundOrder(userId, sellerId);
//		Thread.sleep(2000l);
		int pageNum = 1;
		int pageSize = 1;
		try {
			getSellerMainOrderListBean.setPageSize(pageSize);
			getSellerMainOrderListBean.setSellerId(sellerId);
			getSellerMainOrderListBean.setAddBeginTime(YMTDateUtil.getBeforeOrNextDay(0, YMTDateUtil.YMD));
			getSellerMainOrderListBean.setAddEndTime(YMTDateUtil.getBeforeOrNextDay(0, YMTDateUtil.YMD));
			getSellerMainOrderListBean.setCurrentPageNum(pageNum);
			getSellerMainOrderListCall.setData(getSellerMainOrderListBean);
			getSellerMainOrderListCall.callService();
			Logger.verifyEquals("200", getSellerMainOrderListCall.getCode(),
					"验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

}